#ifndef _TAN_ALLOC_H_
#define _TAN_ALLOC_H_

#include "tanobject.h"

TANTHON_CORE_HANDLE_C_BEGIN

TAN_INTERFACE_FUNC(void*) Tan_malloc(tan_size_t size);
TAN_INTERFACE_FUNC(void*) Tan_realloc(void* ptr, tan_size_t size);

#define Tan_AllocObject(size) (size>=Tan_VarSizeOf ? Tan_malloc(size): tan_assert (0,"Cannot request memory space for object."))
#define Tan_AllocObject_Memset(size) memset(Tan_AllocObject(size), 0, size)

#define Tan_ReallocObject(ob, size) (size>=Tan_VarSizeOf ? \
	Tan_realloc(ob,size) : \
	tan_assert (0,"Cannot request memory space for object."))

#define Tan_ReallocObject_Memset(ob,size) memset(Tan_ReallocObject(ob,size), 0, size)

TANTHON_CORE_HANDLE_C_END

#endif //!_TAN_ALLOC_H_
